<?php
/**
处理TABLE AJAX的

echo json_encode($rs);

		echo "\n";
		echo "\n";
		echo "\n";
		echo "\n";

**/
if($ajax)
{
	$__str = '	{"code":0,"msg":"","count":'.$total . ',"data":';
	$__str .= json_encode($rs);
	$__str .= '}';
	echo $__str;
	exit;



	//old
	ob_start();
	echo '	{"code":0,"msg":"","count":'.$total . ',"data":[';
	foreach ($rs as $k => $v)
	{
		$cnt = 1;
		echo "{";
		foreach($v as $kk => $vv)
		{
			$vv = str_replace('\\','',$vv);
			
			echo '"'.$kk.'":"'.htmlspecialchars($vv) .'"';
			if($cnt < count($v))
			{
				echo ',';				
			}
			$cnt = $cnt + 1;
			echo "\n";
		}
		echo "},";
		echo "\n\n";
	}

	$a = trim(ob_get_contents());
	/*
	$a = str_replace("\n", '', $a);
	$a = preg_replace("/\s/", '', $a);
	$a = str_replace('",}', '"}', $a);
	*/
	ob_clean();
	$a = substr($a,0,-1);
	echo $a . ']}';
	exit;
}